package org.jeecg.modules.gis.mapper;

import org.apache.ibatis.annotations.*;
import org.jeecg.modules.gis.util.mybatis.GisBaseMapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DataManagerMapper extends GisBaseMapper {
    @Select("SELECT table_name FROM information_schema.columns WHERE column_name = 'geom' AND table_schema = DATABASE() GROUP BY table_name")
    List<String> getMysqlTablesWithGeom();

    @Select("SELECT table_name FROM information_schema.columns WHERE column_name = 'geom' AND table_schema = 'public' GROUP BY table_name")
    List<String> getPostgresTablesWithGeom();

    @Select("SELECT table_name FROM all_tab_columns WHERE column_name = 'GEOM' GROUP BY table_name")
    List<String> getOracleTablesWithGeom();

    @Select("SELECT table_name FROM all_tab_columns WHERE UPPER(column_name) = 'GEOM' AND UPPER(owner) = UPPER(#{schema}) GROUP BY table_name")
    List<String> getDmTablesWithGeom(@Param("schema") String schema);

    @Update("${sql}")
    void createTableBySql(@Param("sql") String sql);


    @Update("${sql}")
    void insertBySql(@Param("sql") String sql); // 通用批量插入


}
